package com.xxxx.springboot.shiro;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xxxx.springboot.shiro.config.ResultVO;

@RequestMapping("/user")
@Controller
public class UserController {

	@RequiresPermissions("user:list")
	@ResponseBody
	@RequestMapping("/show")
	public ResultVO<String> showUser() {
		return ResultVO.success("当前登录用户：" + SecurityUtils.getSubject().getPrincipal());
	}

}
